home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
bsrc_250.zip
/
RECVSYNC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-15
|
23KB
|
549 lines
/*--------------------------------------------------------------------------*/
/* */
/* */
/* ------------ Bit-Bucket Software, Co. */
/* \ 10001101 / Writers and Distributors of */
/* \ 011110 / Freely Available<tm> Software. */
/* \ 1011 / */
/* ------ */
/* */
/* (C) Copyright 1987-91, Bit Bucket Software Co., a Delaware Corporation. */
/* */
/* */
/* This module was written by Vince Perriello */
/* */
/* */
/* FidoNet(R) Mail Session Called System Synchronization */
/* */
/* */
/* For complete details of the licensing restrictions, please refer */
/* to the License agreement, which is published in its entirety in */
/* the MAKEFILE and BT.C, and also contained in the file LICENSE.250. */
/* */
/* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
/* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
/* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
/* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT BIT BUCKET */
/* SOFTWARE CO. AT ONE OF THE ADDRESSES LISTED BELOW. IN NO EVENT */
/* SHOULD YOU PROCEED TO USE THIS FILE WITHOUT HAVING ACCEPTED THE */
/* TERMS OF THE BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER */
/* AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO. */
/* */
/* */
/* You can contact Bit Bucket Software Co. at any one of the following */
/* addresses: */
/* */
/* Bit Bucket Software Co. FidoNet 1:104/501, 1:343/491 */
/* P.O. Box 460398 AlterNet 7:491/0 */
/* Aurora, CO 80046 BBS-Net 86:2030/1 */
/* Internet f491.n343.z1.fidonet.org */
/* */
/* Please feel free to contact us at any time to share your comments about */
/* our software and/or licensing policies. */
/* */
/* */
/*--------------------------------------------------------------------------*/
/*
Receiver Synchronization state table.
This logic is used by the called system. It will determine the
type of mail transfer which can be used in communicating with
the calling system.
This stuff was originally copied from a file sent to us by TJ.
(Of course, then we hacked the heck out of it!!!)
Thanks, Tom.
.-----+----------+-------------------------+-------------------------+-----.
| RS0 | SyncInit | | Start 5 second idle tmr | RS1 |
|-----+----------+-------------------------+-------------------------+-----|
| RS1 | IdleWait | 1. 5 sec tmr expired | Take the initiative | RS2 |
| | +-------------------------+-------------------------+-----|
| | | 2. Carrier lost | Session aborted | exit|
| | +-------------------------+-------------------------+-----|
| | | 3. Peek = YOOHOO | Looks like a live WaZOO | RS3 |
| | +-------------------------+-------------------------+-----|
| | | 4. Peek = TSYNC | Live FSC001, we think | RS3 |
| | +-------------------------+-------------------------+-----|
| | | 5. Peek = CR, LF, space | He looks alive | RS2 |
| | +-------------------------+-------------------------+-----|
| | | 6. Other character | Eat it | RS1 |
|-----+----------+-------------------------+-------------------------+-----|
| RS2 |SendBanner| 1. Error returned | Session aborted | exit|
| | +-------------------------+-------------------------+-----|
| | | 2. Banner sent OK | | RS3 |
|-----+----------+-------------------------+-------------------------+-----|
| RS3 |RecvInit | | Init ext-mail scan ptrs | RS4 |
| | | | Start 20 sec timer | |
| | | | Init 10 sec timer | |
|-----+----------+-------------------------+-------------------------+-----|
| RS4 |SendSync | 1. Error returned | Session aborted | exit|
| |(xmit sync+-------------------------+-------------------------+-----|
| |string) | 2. String sent OK | Watch for sender sync | RS5 |
|-----+----------+-------------------------+-------------------------+-----|
| RS5 | WaitSync | 1. Carrier lost | Session aborted | exit|
| | +-------------------------+-------------------------+-----|
| | | 2. YOOHOO received | WaZOO session selected | exit|
| | +-------------------------+-------------------------+-----|
| | | 3. TSYNC received | probable FSC001 | RS6 |
| | +-------------------------+-------------------------+-----|
| | | 4. CR received | Still sync'ing | RS4 |
| | +-------------------------+-------------------------+-----|
| | | 5. ESC received | BBS session | exit|
| | +-------------------------+-------------------------+-----|
| | | 6. Other character rcvd | check ext-mail string | RS7 |
| | +-------------------------+-------------------------+-----|
| | | 7. 10 sec timer elapsed | FSC001 protocol selected| exit|
| | +-------------------------+-------------------------+-----|
| | | 8. 20 sec timer elapsed | Not a mail session | exit|
|-----+----------+-------------------------+-------------------------+-----|
| RS6 | TsyncTmr | 1. Timer not running | Start 10 second timer | RS5 |
| | | | Reset 20 sec timer | |
| | +-------------------------+-------------------------+-----|
| | | 2. Timer running | Two TSYNCS = FTS-0001 | exit|
|-----+----------+-------------------------+-------------------------+-----|
| RS7 | ExtMail | 1. String matched | External mail selected | exit|
| | +-------------------------+-------------------------+-----|
| | | 2. Checked all strings | Get next input character| RS5 |
`-----+----------+-------------------------+-------------------------+-----'
*/
/* Include this file before any other includes or defines! */
#include "includes.h"
/*
* Dat